#ifndef CONFIGHELPER_H
#define CONFIGHELPER_H

#include <QObject>
#include <QSettings>
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;

class ConfigHelper : public QObject
{
    Q_OBJECT
private:
    ConfigHelper(QObject *parent = 0);
public:
    ~ConfigHelper()
    {
        delete setting;
    }

    QVariant GetSettingValue(QString key);

    void SetSettingValue(QString key,QString value);
    static ConfigHelper*getInstance();

    QString GetSaveFolder();
    void SetSaveFolder(QString dir);
private:
    static ConfigHelper*configHelper;
    QSettings *setting;
    int updateEveryDay;
    int onlyChina;
    bool exitAfterUpdate;
    bool isSaveWallpaper;
    QString saveFolder;
    bool protectedWallpaper;
    bool useHttps;

    void LoadSettings(QString filename);
};

#endif // CONFIGHELPER_H
